using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ConversionTools._FromRaster
{
    /// <summary>
    /// <para>Raster to Polyline</para>
    /// <para>Converts a raster dataset to polyline features.</para>
    /// <para>将栅格数据集转换为折线要素。</para>
    /// </summary>    
    [DisplayName("Raster to Polyline")]
    public class RasterToPolyline : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public RasterToPolyline()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_raster">
        /// <para>Input raster</para>
        /// <para><xdoc>
        ///   <para>The input raster dataset.</para>
        ///   <para>The raster must be integer type.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入栅格数据集。</para>
        ///   <para>栅格必须为整数类型。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_polyline_features">
        /// <para>Output polyline features</para>
        /// <para>The output feature class that will contain the converted polylines.</para>
        /// <para>将包含转换后的折线的输出要素类。</para>
        /// </param>
        public RasterToPolyline(object _in_raster, object _out_polyline_features)
        {
            this._in_raster = _in_raster;
            this._out_polyline_features = _out_polyline_features;
        }
        public override string ToolboxName => "Conversion Tools";

        public override string ToolName => "Raster to Polyline";

        public override string CallName => "conversion.RasterToPolyline";

        public override List<string> AcceptEnvironments => ["MDomain", "MResolution", "MTolerance", "XYDomain", "XYResolution", "XYTolerance", "ZDomain", "ZResolution", "ZTolerance", "autoCommit", "configKeyword", "extent", "geographicTransformations", "maintainSpatialIndex", "outputCoordinateSystem", "outputMFlag", "outputZFlag", "outputZValue", "scratchWorkspace", "snapRaster", "workspace"];

        public override object[] ParameterInfo => [_in_raster, _out_polyline_features, _background_value.GetGPValue(), _minimum_dangle_length, _simplify.GetGPValue(), _raster_field];

        /// <summary>
        /// <para>Input raster</para>
        /// <para><xdoc>
        ///   <para>The input raster dataset.</para>
        ///   <para>The raster must be integer type.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入栅格数据集。</para>
        ///   <para>栅格必须为整数类型。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_raster { get; set; }


        /// <summary>
        /// <para>Output polyline features</para>
        /// <para>The output feature class that will contain the converted polylines.</para>
        /// <para>将包含转换后的折线的输出要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output polyline features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_polyline_features { get; set; }


        /// <summary>
        /// <para>Background value</para>
        /// <para><xdoc>
        ///   <para>Specifies the value that will identify the background cells. The raster dataset is viewed as a set of foreground cells and background cells. The linear features are formed from the foreground cells.</para>
        ///   <bulletList>
        ///     <bullet_item>Zero—The background is composed of cells of zero or less or NoData. All cells with a value greater than zero are considered a foreground value.</bullet_item><para/>
        ///     <bullet_item>NoData—The background is composed of NoData cells. All cells with valid values belong to the foreground.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将标识背景单元格的值。栅格数据集被视为一组前景像元和背景像元。线性要素由前景单元格形成。</para>
        ///   <bulletList>
        ///     <bullet_item>零 - 背景由零或更小的单元格或 NoData 组成。所有值大于零的像元都被视为前景值。</bullet_item><para/>
        ///     <bullet_item>NoData - 背景由 NoData 单元格组成。所有具有有效值的单元格都属于前景。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Background value")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _background_value_value _background_value { get; set; } = _background_value_value._ZERO;

        public enum _background_value_value
        {
            /// <summary>
            /// <para>Zero</para>
            /// <para>Zero—The background is composed of cells of zero or less or NoData. All cells with a value greater than zero are considered a foreground value.</para>
            /// <para>零 - 背景由零或更小的单元格或 NoData 组成。所有值大于零的像元都被视为前景值。</para>
            /// </summary>
            [Description("Zero")]
            [GPEnumValue("ZERO")]
            _ZERO,

            /// <summary>
            /// <para>NoData</para>
            /// <para>NoData—The background is composed of NoData cells. All cells with valid values belong to the foreground.</para>
            /// <para>NoData - 背景由 NoData 单元格组成。所有具有有效值的单元格都属于前景。</para>
            /// </summary>
            [Description("NoData")]
            [GPEnumValue("NODATA")]
            _NODATA,

        }

        /// <summary>
        /// <para>Minimum dangle length</para>
        /// <para>Minimum length of dangling polylines that will be retained. The default is zero.</para>
        /// <para>将保留的悬空折线的最小长度。默认值为零。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum dangle length")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _minimum_dangle_length { get; set; } = 0;


        /// <summary>
        /// <para>Simplify polylines</para>
        /// <para><xdoc>
        ///   <para>Simplifies a line by removing small fluctuations or extraneous bends from it while preserving its essential shape.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The polylines will be simplified into simpler shapes such that each contains a minimum number of segments. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The polylines will not be simplified.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>通过消除线条上的微小波动或无关的弯曲来简化线条，同时保留其基本形状。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 折线将被简化为更简单的形状，以便每个折线包含最少数量的线段。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 折线不会被简化。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Simplify polylines")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _simplify_value _simplify { get; set; } = _simplify_value._true;

        public enum _simplify_value
        {
            /// <summary>
            /// <para>SIMPLIFY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("SIMPLIFY")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_SIMPLIFY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_SIMPLIFY")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Field</para>
        /// <para><xdoc>
        ///   <para>The field used to assign values from the cells in the input raster to the polyline features in the output dataset.</para>
        ///   <para>It can be an integer or a string field.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于将输入栅格中像元中的值分配给输出数据集中的折线要素的字段。</para>
        ///   <para>它可以是整数或字符串字段。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _raster_field { get; set; } = null;


        public RasterToPolyline SetEnv(object MDomain = null, object MResolution = null, object MTolerance = null, object XYDomain = null, object XYResolution = null, object XYTolerance = null, object ZDomain = null, object ZResolution = null, object ZTolerance = null, int? autoCommit = null, object configKeyword = null, object extent = null, object geographicTransformations = null, bool? maintainSpatialIndex = null, object outputCoordinateSystem = null, object outputMFlag = null, object outputZFlag = null, object outputZValue = null, object scratchWorkspace = null, object snapRaster = null, object workspace = null)
        {
            base.SetEnv(MDomain: MDomain, MResolution: MResolution, MTolerance: MTolerance, XYDomain: XYDomain, XYResolution: XYResolution, XYTolerance: XYTolerance, ZDomain: ZDomain, ZResolution: ZResolution, ZTolerance: ZTolerance, autoCommit: autoCommit, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, maintainSpatialIndex: maintainSpatialIndex, outputCoordinateSystem: outputCoordinateSystem, outputMFlag: outputMFlag, outputZFlag: outputZFlag, outputZValue: outputZValue, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, workspace: workspace);
            return this;
        }

    }

}